package psu.kit;

public class ArrayHandler {
    public int handelArray(int[] array) {
            int[] Mas = new int[array.length];
            int j = 0;
            //throw new UnsupportedOperationException("Not implemented method");
            int count = 0;
            for (int i = 0; i < array.length; i++) {
                if (array[i] != 0) {
                    count++;
                    Mas[j] = array[i];
                    j++;
                }
            }

            for (int m = 0; m < array.length; m++) {
                if (array[m] == 0) {
                    Mas[j] = array[m];
                    j++;
                }
            }
            for (int l=0;l<array.length;l++)
            {
                array[l]=Mas[l];
            }
            return count;
        }
}
